package com.lcj.odr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lcj.odr.controller.form.SearchMonitoringForm;
import com.lcj.odr.db.dao.OrderMonitoringDao;
import com.lcj.odr.db.pojo.OrderMonitoringEntity;
import com.lcj.odr.service.MonitoringService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MonitoringServiceImpl implements MonitoringService {

    @Resource
    private OrderMonitoringDao orderMonitoringDao;

    /**
     * 分页查询订单监控记录
     * @param form
     * @return
     */
    @Override
    public PageInfo<OrderMonitoringEntity> searchOrderMonitoringByPage(SearchMonitoringForm form) {
        PageHelper.startPage(form.getPage(), form.getLength());
        List<OrderMonitoringEntity> orderMonitoring = orderMonitoringDao.getOrderMonitoring();
        PageInfo<OrderMonitoringEntity> pageInfo = new PageInfo<>(orderMonitoring);
        return pageInfo;
    }
}
